package com.outsider.util;


import com.jfinal.weixin.sdk.api.AccessTokenApi;
import com.jfinal.weixin.sdk.api.MediaFile;
import com.jfinal.weixin.sdk.utils.HttpUtils;

/**
 * 下载语音消息Api
 * @author outsider
 */

public class VoiceApi {
	private static String getVoice = "https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID";
	public static MediaFile getVoice(String mediaID){
		String url=getVoice.replace("ACCESS_TOKEN", AccessTokenApi.getAccessTokenStr()).replace("MEDIA_ID", mediaID);
	    System.out.println(url);
		return HttpUtils.download(url);
	}
	
	
}
